#include "image.h"
#include "texture.h"

Image::Image(Texture* pTexture, const KPoint2& cPosition, const KSize& cSize)
	: m_pTexture(pTexture)
	, m_cPosition(cPosition)
	, m_cSize(cSize)
{
	m_pTexture->AddRef();
}

Image::~Image()
{
	m_pTexture->Release();
}

bool Image::LoadRawData(byte* pMem, const KSize& cSize, int nPitch, PixelFormat emFormat)
{
	return m_pTexture->UpdateRegion(m_cPosition, pMem, cSize, nPitch, emFormat);
}
